<template>
  <div class="company-name-container">
    <div class="company-item" v-for="(item,index) in companyNames" :class="{'text-right':companyNames.length===2&&index===0,'half-width': companyNames.length===2,'fixed-width': companyNames.length!==2}">
      <div class="side">{{index | sideFilter}}</div>
      <div class="company-name">{{item.name}}</div>
    </div>
  </div>
</template>
<script type="text/javascript">
export default {
  props: {
    companyNames: Array
  },
  filters: {
    sideFilter(v) {
      if (v === 0) {
        return '甲方'
      }
      if (v === 1) {
        return '乙方'
      }
      if (v === 2) {
        return '丙方'
      }
      if (v === 3) {
        return '丁方'
      }
      if (v === 4) {
        return '戊方'
      }
      return ''
    }
  }
}

</script>
<style type="text/css" scoped>
.company-name-container {
  white-space: nowrap;
}

.text-right {
  text-align: right;
}

.half-width {
  width: 50%;
}

.fixed-width {
  width: 470px;
  padding: 15px 100px !important;
}

.company-item {
  display: inline-block;
  padding: 15px 20px;
  font-size: 14px;
}

.side {
  color: #818181;
}

.company-name {
  margin-top: 15px;
  color: #01378c;
  font-weight: 700;
}

</style>
